// //专门用来处理路由的
const Router = require('koa-router')

const { userValidator,verifyUser } = require('../middleware/user.middleware')
const {register,login} = require('../controller/user.controller')

const router = new Router({prefix:'/users'})//指的是 直接在localhost:8000/users下

// // GET /users/
// router.get('/',(ctx,next)=>{
//     ctx.body = 'hello users'
// })


// //注册接口  意思是 经过中间件 先userValidator  verifyUser register
router.post('/register',userValidator,verifyUser,register)
// //登录接口
router.post('/login',login)



module.exports = router